const http = require("http");
const fs = require("fs");
const path = require("path");
http.createServer((req,res)=>{
	if(req.url==="/"){
		fs.readFile(path.resolve(__dirname,"./index.html"),(err,result)=>{
			res.end(result);
		})
		
	}else if(req.url === "/style.css"){
		fs.readFile(path.resolve(__dirname,"./style.css"),(err,result)=>{
			res.end(result);
		})
	}
	else{
		res.end("404,您找的页面不存在！")
	}
	
}).listen(80,()=>{
	console.log("success");
})